package com.sci.service.impl;

import com.sci.entity.Shipment;
import com.sci.mapper.ShipmentMapper;
import com.sci.service.ShipmentService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class ShipmentServiceImpl implements ShipmentService {
    @Resource
    private ShipmentMapper shipmentMapper;

    @Override
    @Transactional
    public boolean insert(Shipment shipment) {
        return shipmentMapper.insert(shipment) > 0;
    }

    @Override
    @Transactional
    public boolean deleteById(Integer id) {
        return shipmentMapper.deleteById(id) > 0;
    }

    @Override
    @Transactional
    public boolean updateById(Shipment shipment) {
        return shipmentMapper.updateById(shipment) > 0;
    }

    @Override
    public List<Shipment> selectByWechatId(String wechatId) {
        return shipmentMapper.selectByWechatId(wechatId);
    }
}
